﻿@model BTTechnologies.MedScience.MVC.Models.RestorePasswordModel
@{
    ViewBag.Title = MedSiteStrings.RestoaringPasswordTitle;
}

<hgroup class="title">
    <h1>@MedSiteStrings.RestoaringPasswordTitle</h1>
</hgroup>

<section id="centeredForm">
    @if (Model.Success == true)
    {
        <p class="big-text okColor">@MedSiteStrings.PasswordIsChangedSuccessful</p>
    }
    else
    {
        if (Model.Success == false)
        {
            <p class="big-text errorColor">@MedSiteStrings.ErrorWhenChangingPassword</p>
            @Html.ValidationSummary(false)
        }
        else
        {
            <p>@string.Format(MedSiteStrings.PasswordVerificationCodeWasSent, @Model.UserLogin)</p>
            using (Html.BeginForm())
            {
                @Html.AntiForgeryToken()

                <fieldset>
                    <legend>@MedSiteStrings.ChangingPasswordFormTitle</legend>
                    @Html.HiddenFor(m => m.UserLogin)

                    <ol>
                        <li>
                            @Html.LabelFor(m => m.Password)
                            @Html.PasswordFor(m => m.Password)
                        </li>
                        <li>
                            @Html.LabelFor(m => m.ConfirmPassword)
                            @Html.PasswordFor(m => m.ConfirmPassword)
                        </li>
                        <li>
                            @Html.LabelFor(m => m.VerificationCode)
                            @Html.TextBoxFor(m => m.VerificationCode)
                        </li>
                    </ol>
                    <input type="submit" value="@MedSiteStrings.SavePassword" />
                </fieldset>
            }
        }
    }
</section>

@section scripts {
    <script type="text/javascript" src="@Url.Content("~/Scripts/ValidationMessages.js")"></script>
}
